package test;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class SetScopeBean2 extends HttpServlet{
	@Override
	protected void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{
		Address addr1=new Address("沈阳","浑南新区");
		request.setAttribute("addr1", addr1);
		Address addr2=new Address("成都","浑南新区");
		HttpSession session=request.getSession();
		session.setAttribute("addr1",addr2);
		session.setAttribute("addr2",addr2);
		Address addr3=new Address("西宁","浑南新区");
		ServletContext application=getServletContext();
		application.setAttribute("addr1", addr3);
		application.setAttribute("addr2", addr3);
		application.setAttribute("addr3", addr3);
		RequestDispatcher rd=request.getRequestDispatcher("readScopeBean.jsp");
		rd.forward(request, response);
	}
}
